home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Swimwear Illustrated
/
Swimwear Illustrated.iso
/
mac
/
MAIN8
/
MAIN8.DIR
/
00017_Script_17
< prev
next >
Wrap
Text File
|
1996-02-22
|
3KB
|
56 lines
--
on initButtons -- so they are mouse down responsive
global FirstBtnCast, FirstBtnTrack, LastBtnTrack
-- ButtonCast: 1st "invisible" target, 2nd: generic rollover hilite
-- remaining ones "pushed down" with b.g. copied on face 1 for each button
---------------------------------------------------------------------
--<<<< Change the 3 values below to match your design >>>>--
put 1 into FirstBtnCast --*** change this when shuffling cast ***
put 3 into FirstBtnTrack --*** change this to match score ***
put 4 into NumberofBtns --*** chance this to match your setup ***
---------------------------------------------------------------------
put FirstBtnTrack + NumberofBtns- 1 into LastBtnTrack
repeat with i = FirstBtnTrack to LastBtnTrack
set the immediate of sprite i to true -- for mouse Down score script activation
end repeat
on ScanButtons
global lastHiBtn,FirstBtnCast,FirstBtnTrack, LastBtnTrack
put 0 into overBtn
repeat with i = FirstBtnTrack to LastBtnTrack -- test for mouse over buttons
if rollOver(i) then
put i into overBtn -- found one
exit repeat -- save time, scan no farther
end if
end repeat
if overBtn <> lastHiBtn and lastHiBtn <> 0 then -- previously hilited one
-- make previous hi btn generic "invisible" target rectangle
set the castNum of sprite lastHiBtn to FirstBtnCast
set the puppet of sprite lastHiBtn to false -- return score control, for simplicity
end if
put overBtn into lastHiBtn -- to be restored later
if overBtn > 0 then -- over any btn
set the puppet of sprite overBtn to true -- changable
set the castNum of sprite overBtn to FirstBtnCast + i-2 -- generic roll over hilite image
updateStage
end if
on HitMe Destination -- mouse is down on an (immediate) button
global FirstBtnCast, FirstBtnTrack
put clickon() into target
set the puppet of sprite target to true -- changable (redundent if hilited, but harmless)
put FirstBtnCast + 2 + ( target - FirstBtnTrack) into SquishedBtnCast
set the castNum of sprite target to SquishedBtnCast -- mouse down state
sound playfile 1, "buttonclick"
updateStage
-- All the code in this repeat loop is to make hilite "Apple legal"
-- the loop could be empty and still function.
repeat while stillDown() -- (stillDown: momentary releases are always reported)
if rollover(target) then set the castNum of sprite target to SquishedBtnCast
else set the castNum of sprite target to FirstBtnTrack -- mouse down, but not on btn
updateStage
end repeat
-- the rest is effectively the mouseUp script
set the castNum of sprite target to FirstBtnCast
set the puppet of sprite target to false -- so it's not stuck in destination screen
if rollover(target) then play frame Destination --*** the button's ultimate action